package com.salelogistics.sale.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.salelogistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salelogistics.sale.mapper.SmsDeliveryPlanDetailsMapper;
import com.salelogistics.sale.domain.SmsDeliveryPlanDetails;
import com.salelogistics.sale.service.ISmsDeliveryPlanDetailsService;

/**
 * 月配送计划详细货物Service业务层处理
 *
 * @author Hu Kangying
 * @date 2023-07-13
 */
@Service
public class SmsDeliveryPlanDetailsServiceImpl extends ServiceImpl<SmsDeliveryPlanDetailsMapper,SmsDeliveryPlanDetails>
        implements ISmsDeliveryPlanDetailsService {

    @Autowired
    private SmsDeliveryPlanDetailsMapper smsDeliveryPlanDetailsMapper;

    /**
     * 查询月配送计划详细货物
     *
     * @param id 月配送计划详细货物主键
     * @return 月配送计划详细货物
     */
    @Override
    public SmsDeliveryPlanDetails selectSmsDeliveryPlanDetailsById(Long id) {
        return smsDeliveryPlanDetailsMapper.selectSmsDeliveryPlanDetailsById(id);
    }

    /**
     * 查询月配送计划详细货物列表
     *
     * @param smsDeliveryPlanDetails 月配送计划详细货物
     * @return 月配送计划详细货物
     */
    @Override
    public List<SmsDeliveryPlanDetails> selectSmsDeliveryPlanDetailsList(SmsDeliveryPlanDetails smsDeliveryPlanDetails) {
        return smsDeliveryPlanDetailsMapper.selectSmsDeliveryPlanDetailsList(smsDeliveryPlanDetails);
    }

    /**
     * 新增月配送计划详细货物
     *
     * @param smsDeliveryPlanDetails 月配送计划详细货物
     * @return 结果
     */
    @Override
    public int insertSmsDeliveryPlanDetails(SmsDeliveryPlanDetails smsDeliveryPlanDetails) {
        smsDeliveryPlanDetails.setCreateTime(DateUtils.getNowDate());
        return smsDeliveryPlanDetailsMapper.insertSmsDeliveryPlanDetails(smsDeliveryPlanDetails);
    }

    /**
     * 修改月配送计划详细货物
     *
     * @param smsDeliveryPlanDetails 月配送计划详细货物
     * @return 结果
     */
    @Override
    public int updateSmsDeliveryPlanDetails(SmsDeliveryPlanDetails smsDeliveryPlanDetails) {
        return smsDeliveryPlanDetailsMapper.updateSmsDeliveryPlanDetails(smsDeliveryPlanDetails);
    }

    /**
     * 批量删除月配送计划详细货物
     *
     * @param ids 需要删除的月配送计划详细货物主键
     * @return 结果
     */
    @Override
    public int deleteSmsDeliveryPlanDetailsByIds(Long[] ids) {
        return smsDeliveryPlanDetailsMapper.deleteSmsDeliveryPlanDetailsByIds(ids);
    }

    /**
     * 删除月配送计划详细货物信息
     *
     * @param id 月配送计划详细货物主键
     * @return 结果
     */
    @Override
    public int deleteSmsDeliveryPlanDetailsById(Long id) {
        return smsDeliveryPlanDetailsMapper.deleteSmsDeliveryPlanDetailsById(id);
    }
}
